﻿<%@ Page Language="C#" MasterPageFile="~/Template/Site_Main.Master" AutoEventWireup="true"
    CodeBehind="studentinfo_contrast.aspx.cs" Inherits="RegisterationSystem.Space_School.studentinfo_contrast" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
      <!--
        $(function () {
            //设置导航位置
            setLocalToParent();
            //初始化隐藏层
            $('#plastudentinfo').dialog({
                closed: true
            });
            $('#plastudentctinfo').dialog({
                closed: true
            });
            //初始化企业用户数据列表控件
            $("#dg").datagrid({
                idField: "id",      //标识字段,主键
                url: "../SyncService/GetDataList.ashx?action=getstudentcompareinfolistbyschid",
                queryParams: { "where": "1=1" },
                pagination: true,   //是否开启分页
                rownumbers: true,   //行号
                pageSize: 10,
                pageNumber: 1,
                columns: [[
                             { field: 'ck', checkbox: true },
                            { field: 'truename', title: '学生姓名', width: 105, align: 'center' },
                            { field: 'birthday', title: '出生日期', width: 105, align: 'center', formatter: function (value, row, index) {
                                var temp = new Array();
                                temp = value.split(" ");
                                return temp[0];
                            }
                            },

                            { field: 'sex', title: '性别', width: 60, align: 'center', formatter: function (value, row) {
                                if (value) {
                                    return "女";
                                } else {
                                    return "男";
                                }
                            }
                            },
                            { field: 'idcardnumber', title: '证件号(身份证/护照)', width: 150, align: 'center' },
                            { field: 'permanentaddress', title: '户籍地址', width: 400, align: 'center' },
                            { field: 'id', title: '操作', width: 160, align: 'center', formatter: function (value, row) {
                                var res = "<a href='javascript:void(0)'  onclick='GetByStudentInfo(" + value + ");'>查看详细信息</a>";
                                res += "  <a href='javascript:void(0)'  onclick='GetByStudentCtInfo(" + value + ");'>查看对比信息</a>";
                                return res;
                            }
                            }
                         ]],
                rowStyler: function (index, row) {
                    switch (row.compareresult) {
                        case "0":
                            //return 'background-color:white;';
                            break;
                        case "1":
                            return 'background-color:#CDC673;';
                            break;
                        case "2":
                            return 'background-color:#CDC5BF;';
                            break;
                        case "3":
                            return 'background-color:#FF6A6A;';
                            break;
                        //                                default:         
                        //                                return 'color:yellow;';         
                    }
                }

            })
        });
        //-->
        //统计
        function SelStuList() {
            var where = "";
            where += $("#txtname").val() + ","; //住房社区
            where += $("#txtCard").val() + ""; //住房小区
            $('#dg').datagrid({ url: "../SyncService/GetDataList.ashx?action=getstudentcompareinfolistbyschid", queryParams: { "where": where} });
            $('#dg').datagrid('reload');
        }

        //弹出学生详细信息
        function GetByStudentInfo(stdID) {
            $.post("../SyncService/GetDataList.ashx",
                { "action": "GetStudentByID", "id": stdID },
                function (cStr) {
                    var stdInfo = eval('(' + cStr + ')');
                    $("#<%= hidstuID.ClientID %>").val(stdID);
                    $("#spanname").text(stdInfo.name); //姓名
                    $("#spansex").text(stdInfo.sex); //性别
                    $("#spanbirthday").text(stdInfo.birthday); //出生年月
                    $("#spanidcardnumber").text(stdInfo.idcardnumber); //学生身份证
                    $("#HouseIngoingTime").text(stdInfo.HouseIngoingTime); //户口迁入时间
                    $("#HousingOccupancyTime").text(stdInfo.HousingOccupancyTime); //住房入住时间
                    $("#PermanentAddress").text(stdInfo.PermanentAddress); //户籍地址
                    // $("#spanhobby").text(stdInfo.hobby);//兴趣爱好
                    $("#spanfirstguardianname").text(stdInfo.firstguardianname); //第一监护人
                    $("#spanfirstguardianunit").text(stdInfo.firstguardianunit); //工作单位
                    $("#spanfirstguardianphone").text(stdInfo.firstguardianphone); //联系电话
                    $("#spansecguardianname").text(stdInfo.secguardianname); //第二监护人
                    $("#spansecguardianunit").text(stdInfo.secguardianunit); //工作单位
                    $("#spansecguardianphone").text(stdInfo.secguardianphone); //联系电话
                    switch (stdInfo.houseareaid) {
                        case "0":
                            $("#spanhouseareaid").text("武汉经济技术开发区（汉南区）"); //户口所在地
                            break;
                        case "1":
                            $("#spanhouseareaid").text("市内其它区"); //户口所在地
                            break;
                        case "2":
                            $("#spanhouseareaid").text("省内市外、外省外市"); //户口所在地
                            break;
                        case "3":
                            $("#spanhouseareaid").text("外籍(含港澳台)"); //户口所在地
                            break;
                    }
                    $("#spanpcommname").text(stdInfo.pcommname); //住房社区
                    $("#spanscommname").text(stdInfo.scommname); //住房社区
                    $("#spanxcommname").text(stdInfo.xcommname); //住房小区
                    $("#spanhousenumber").text(stdInfo.housenumber); //门牌号
                    $("#spanhousecard").text(stdInfo.housecard); //房产号
                    $("#spanfirstrelationship").text(stdInfo.firstrelationship); //与学生关系
                    $("#spansecrelationship").text(stdInfo.secrelationship); //与学生关系
                },
                "text");
            //弹层
            $('#plastudentinfo').dialog({
                title: '学生信息',
                width: 600,
                height: 425,
                closed: false,
                cache: false,
                modal: true,
                collapsible: true,
                maximizable: false
            });
        }
        //弹出学生详细信息
        function GetByStudentCtInfo(stdID) {
            //alert(stdID);
            $("#dgCt").datagrid({
                idField: "id",      //标识字段,主键
                url: "../SyncService/GetDataList.ashx?action=getstudentctbyid",
                queryParams: { "where": "1=1", "id": stdID },
                pagination: true,   //是否开启分页
                rownumbers: true,   //行号
                pageSize: 10,
                pageNumber: 1,
                columns: [[
                            { field: 'ctname', title: '学生姓名', width: 105, align: 'center' },
                            { field: 'ctbirthday', title: '出生日期', width: 105, align: 'center', formatter: function (value, row, index) {
                                var temp = new Array();
                                temp = value.split(" ");
                                return temp[0];
                            }
                            },

                            { field: 'ctsex', title: '性别', width: 60, align: 'center', formatter: function (value, row) {
                                if (value) {
                                    return "女";
                                } else {
                                    return "男";
                                }
                            }
                            },
                            { field: 'ctaddress', title: '户籍地址', width: 400, align: 'center' },
                            { field: 'ctguardname', title: '户主姓名', width: 80, align: 'center' },
                            { field: 'ctguardrelation', title: '与户主户主', width: 80, align: 'center' }
                         ]],
                onLoadSuccess: function (data) {
                    var data = $('#dgCt').datagrid('getData');
                    //                            alert(data.total);
                    if (data.total == 0) {
                        $.messager.alert("消息提示", "查无此人！");
                    } else {
                        //弹层
                        $('#plastudentctinfo').dialog({
                            title: '学生对比信息',
                            width: 900,
                            closed: false,
                            cache: false,
                            modal: true,
                            collapsible: true,
                            maximizable: false
                        });
                    }
                }
            });
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Place_Local" runat="server">
    <div class="localTitle">
        <a>学生信息统计</a>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <!--选择的学生信息编号-->
    <asp:HiddenField ID="hidstuID" runat="server" />
    <div class="loadheight">
        <table width="100%%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td bgcolor="#FFFFFF">
                    <table width="100%%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td>
                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                </table>
                            </td>
                        </tr>
                    </table>
                    <table width="100%%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td class="cen_R_dh">
                                <strong>学生信息统计条件</strong>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <table width="100%" border="0" cellpadding="0" cellspacing="1">
                                    <tr>
                                        <td height="20">
                                            <table width="100%%" border="0" cellspacing="0" cellpadding="3">
                                            </table>
                                            <div style="margin-top: 5px">
                                            </div>
                                            <table width="688" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
                                                <tr>
                                                    <td width="100" height="20" align="center" bgcolor="#FFFFFF">
                                                        学生姓名
                                                    </td>
                                                    <td width="200" bgcolor="#FFFFFF">
                                                        <input type="text" id="txtname" style="width: 130px;" class="easyui-validatebox"
                                                            maxlength="20" />
                                                    </td>
                                                    <td width="140" align="center" bgcolor="#FFFFFF">
                                                        证件号(身份证/护照)
                                                    </td>
                                                    <td align="left" bgcolor="#FFFFFF">
                                                        <input type="text" id="txtCard" style="width: 130px;" class="easyui-validatebox"
                                                            maxlength="40" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                    <div style="margin-top: 5px">
                    </div>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="200">
                                &nbsp;
                            </td>
                            <td>
                                <input type="button" name="button" id="button" value="统计" class="anniu" width="73"
                                    height="27" onclick="SelStuList();" />
                            </td>
                        </tr>
                    </table>
                    <div style="height: 5px;">
                    </div>
                    <table width="100%%" border="0" cellspacing="0" cellpadding="1">
                        <tr>
                            <td class="cen_R_dh">
                                <strong>学生信息统计列表</strong>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <table width="100%%" border="0" cellspacing="0" cellpadding="1">
                                    <tr>
                                        <td style="background: #CDC673" width="60">
                                        </td>
                                        <td>
                                            不存在该学生的信息
                                        </td>
                                        <td style="background: #CDC5BF" width="60">
                                        </td>
                                        <td>
                                            该学生户籍信息不正确
                                        </td>
                                        <td style="background: #FF6A6A" width="60">
                                        </td>
                                        <td>
                                            该学生性别或出生日期不正确
                                        </td>
                                    </tr>
                                </table>
                                <!-- 创建数据列表控件 -->
                                <table id="dg">
                                </table>
                                <div style="height: 10px;">
                                </div>
                                <%-- <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td align="left">
                                            <input type="button" name="button1" id="button3" value="选定导出Excel" class="anniu_big"
                                                width="73px" height="23px" onclick="derive_excel();" />
                                            <input type="button" name="button1" id="button4" value="全部导出Excel" class="anniu_big"
                                                height="23px" onclick="derive_excelAll();" />
                                        </td>
                                    </tr>
                                </table>--%>
                            </td>
                        </tr>
                    </table>
                    <!--弹出学生详细信息-->
                    <div id="plastudentinfo" class="easyui-dialog tcc_M">
                        <div class="tcc_div" style="margin-left: 20px;">
                            <ul>
                                <li class="tcc_BT">学生详细信息</li>
                                <li>姓名：<span id="spanname"></span></li>
                                <li>性别：<span id="spansex"></span></li>
                                <li>证件号(身份证/护照)：<span id="spanidcardnumber"></span>&nbsp;<a href='javascript:void(0)'
                                    onclick='UpdStudentPswdReset(123456);' style="color: #990000">密码重置</a></li>
                                <li>出生年月：<span id="spanbirthday"></span></li>
                                <li>户口所在地：<span id="spanhouseareaid"></span></li>
                                <li>住房片区：<span id="spanpcommname"></span></li>
                                <li>住房社区：<span id="spanscommname"></span></li>
                                <li>住房小区：<span id="spanxcommname"></span></li>
                                <li>门牌号：<span id="spanhousenumber"></span></li>
                                <li>房产证号：<span id="spanhousecard"></span></li>
                                <li>户口迁入时间：<span id="HouseIngoingTime"></span></li>
                                <li>住房入住时间：<span id="HousingOccupancyTime"></span></li>
                                <li>户籍地址：<span id="PermanentAddress"></span></li>
                                <%--<li>兴趣爱好：<span id="spanhobby"></span></li>--%>
                            </ul>
                        </div>
                        <div class="tcc_div" style="float: right">
                            <ul>
                                <li class="tcc_BT">监护人信息</li>
                                <li>第一监护人：<span id="spanfirstguardianname"></span></li>
                                <li>与学生关系：<span id="spanfirstrelationship"></span></li>
                                <li>工作单位：<span id="spanfirstguardianunit"></span></li>
                                <li>联系电话：<span id="spanfirstguardianphone"></span></li>
                                <li>&nbsp;</li>
                                <li>第二监护人：<span id="spansecguardianname"></span></li>
                                <li>与学生关系：<span id="spansecrelationship"></span></li>
                                <li>工作单位：<span id="spansecguardianunit"></span></li>
                                <li>联系电话：<span id="spansecguardianphone"></span></li>
                            </ul>
                        </div>
                    </div>
                    <div id="plastudentctinfo" class="easyui-dialog tcc_M">
                        <table id="dgCt">
                        </table>
                        <%--<div class="tcc_div" style="margin-left: 20px;">
                            <ul>
                                <li class="tcc_BT">学生对比信息</li>
                                <li>姓名：<span id="ctname"></span></li>
                                <li>性别：<span id="ctsex"></span></li>
                                <li>出生年月：<span id="ctbirthday"></span></li>
                                <li>户籍地址：<span id="ctAddress"></span></li>
                                <li>户主姓名：<span id="spanguardName"></span></li>
                                <li>与户主关系：<span id="spanguardrelation"></span></li>
                            </ul>
                        </div>--%>
                    </div>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
